#region License

/*
  GShield - Game Shield
  Copyright (C) 2006-2007 WaveTech Digital Technologies, Inc.
                                http://www.wtdt.com

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#endregion License

#region Includes

using System;
using System.Drawing;
using System.Windows.Forms;
using WaveTech.GShield.Data;
using WaveTech.GShield.Engine.Factories;
using WaveTech.GShield.Engine.Managers;
using WaveTech.GShield.Engine.Tools;
using WaveTech.GShield.Manager.Properties;

#endregion

namespace WaveTech.GShield.Manager
{
	public partial class Dashboard : Form
	{
		#region Constructor

		public Dashboard()
		{
			InitializeRequiredSystems();
			InitializeComponent();
		}

		#endregion Constructor

		#region Dashboard_Load

		private void Dashboard_Load(object sender, EventArgs e)
		{
			m_bannerImage.Image = BannerFactory.CreateBanner(m_bannerImage.Width,
			                                                 m_bannerImage.Height, BannerFactory.BannerStyle.WinVistaBlack,
			                                                 new Bitmap(Resources.B256x256_Info, new Size(48, 48)),
			                                                 "GShield Manager",
			                                                 "Welcome to the GShield Management Console");

			GetStats();
		}

		#endregion Dashboard_Load

		#region Initialize Required Systems

		private void InitializeRequiredSystems()
		{
		}

		#endregion Initialize Required Systems

		#region Get Stats

		private void GetStats()
		{
			lblRatingPoliciesCount.Text = RatingsPolicyDAO.GetAllRatingPolicyUsers().Count.ToString();
			lblUsagePoliciesCount.Text = UsageDAO.GetAllUsagePolicyUsers().Count.ToString();
			lblGamesCount.Text = GamesDAO.GetGameList().Count.ToString();
			lblBannedGamePoliciesCount.Text = BannedDAO.GetAllBannedPolicyUsers().Count.ToString();
			lblNumberOfBannedPoliciesCount.Text = "0";
		}

		#endregion Get Stats

		#region llbRatingsGuide_LinkClicked

		private void llbRatingsGuide_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Links.LaunchUrl(Settings.Default.Links_ESRBRatingsGuide);
		}

		#endregion llbRatingsGuide_LinkClicked

		#region llbVisitESRBSite_LinkClicked

		private void llbVisitESRBSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Links.LaunchUrl(Settings.Default.Links_ESRBWebiste);
		}

		#endregion llbVisitESRBSite_LinkClicked

		#region llbProjectPage_LinkClicked

		private void llbProjectPage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Links.LaunchUrl(Settings.Default.Links_ProjectPage);
		}

		#endregion llbProjectPage_LinkClicked

		#region llbOpenSourceInitiative_LinkClicked

		private void llbOpenSourceInitiative_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Links.LaunchUrl(Settings.Default.Links_OpenSourceInitiative);
		}

		#endregion llbOpenSourceInitiative_LinkClicked

		#region llbViewDocumentation_LinkClicked

		private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Help.ShowHelp(this, Settings.Default.HelpFileName, HelpNavigator.TableOfContents);
		}

		#endregion llbViewDocumentation_LinkClicked

		#region llbRatingsPolicies

		private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			WindowManager.AddWindow(new RatingPolicies());
		}

		#endregion llbRatingsPolicies

		#region llbUsagePolicies_LinkClicked

		private void llbUsagePolicies_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			WindowManager.AddWindow(new UsagePolicies());
		}

		#endregion llbUsagePolicies_LinkClicked

		#region llbBannedGames_LinkClicked

		private void llbBannedGames_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			WindowManager.AddWindow(new BannedGames());
		}

		#endregion llbBannedGames_LinkClicked
	}
}